<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserAddress extends Model
{
    protected $guarded = [];
    public $timestamps = false;

    public function setDefaultAddress($address_id, $user_id)
    {
        $this->newQuery()->where('user_id',$user_id)->update(['is_default' => 0]);
        $this->newQuery()->where('id',$address_id)->update(['is_default' => 1]);
    }
}
